<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    Funtion.prototype.myCall = function (context) {
      //设置默认参数为window
      var context = context || window
      //给新对象添加方法fn
      //getValue.call(a,1,2) =>  a.fn = getValue
      //此处this.指向调用myCall的对象
      context.fn = this
      //取出除第一个以外的参数
      var args = [...arguments].slice(1)
      //
      var result = context.fn(...args)  // 执行结果result
      delete context.fn
      return result
    }
  </script>
</body>

</html>